<% add_decidim_page_title(t(".title")) %>
<div class="card">
  <div class="item_show__header">
    <h1 class="item_show__header-title">
      <%= t ".title" %>
    </h1>
  </div>

  <div class="card-section">
    <div class="grid md:grid-cols-2 gap-x-8 p-4">
      <% templates.each do |newsletter_template| %>
        <div class="card pb-12 md:pb-0" id="<%= newsletter_template.name %>">
          <iframe src="<%= preview_newsletter_template_path(newsletter_template.name) %>" class="w-full h-[60dvh]" data-email-preview>
          </iframe>
          <div class="card-footer">
            <h2 class="card-title flex items-center">
              <%= t newsletter_template.public_name_key %>
              <div class="ml-auto">
                <%= link_to(t(".preview_template"), newsletter_template_path(newsletter_template.name), class: "button button__sm button__secondary") %>
                <%= link_to(t(".use_template"), new_newsletter_template_newsletter_path(newsletter_template.name), class: "button button__sm button__secondary") %>
              </div>
            </h2>
          </div>
        </div>
      <% end %>
    </div>
  </div>
</div>
